Java.perform(function () {

    var Cipher = Java.use("javax.crypto.Cipher");
    var ByteString = Java.use("com.android.okhttp.okio.ByteString");


    Cipher.doFinal.overload('[B').implementation = function (data) {
        console.log("-----------------------AES加密---------------------------");
        console.log("AES明文：",ByteString.of(data).utf8());
        var res = this.doFinal(data);
        // console.log('AES密文：',JSON.stringify(res));
        console.log('AES密文：',ByteString.of(res).hex());
        //console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
        return res;
    }

});

// frida -U -f  com.achievo.vipshop -l  13_hook_JS_doFinal.js
// frida -H 127.0.0.1:8877 -l  13_hook_JS_doFinal.js -f com.achievo.vipshop
// frida -UF -l hook.js